home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-21 | 7.1 KB | 325 lines | [TEXT/DMOS] |
- { From user Brian Sterling, Project Discdist at Mon, Mar 21, 1994 10:53 AM}
-
-
- { System Variables with non-default values: }
- Samplesize := 200
- Windows := 2
- Typechecking := 1
- Checking := 1
- Saveoptions := 2
- Savevalues := 0
-
-
- { Non-default Time SysVar value: }
- Time := [0,1,2]
-
- Attribute Reference
-
- Attribute Date_bough
-
- Project Discdist
- Title: More Discrete Distributions
- Description: Additional discrete distributions implemented using a ~
- user-defined function.~
- ~
- This example also shows how to force Demos™ to display a ~
- discrete probability distribution as a probability mass ~
- function.~
- ~
- Note: You must edit 'x index' (or x2 if you use
- Hypergeometric) to span the range of your x values. This is~
- a hack that will hopefully not be necessary in future ~
- versions of Demos.~
-
- Author: Brian Sterling
- Date: Fri, Feb 4, 1994 11:14 AM
- Saveauthor: Brian Sterling
- Savedate: Mon, Mar 21, 1994 10:53 AM
- Diagstate: 1,82,40,346,393,1
- Fileinfo: 0,-4,11516,Project Discdist,More Discrete Distributions
- Getresource Pagesetup,1
-
- Index Xindex
- Title: x index
- Description: Index for the x values.~
- ~
- Edit this to span the range of your x values.
- Definition: sequence(0,30)
- Location: 80,320
- Nodesize: 48,20
- Nodeinfo: 1,1,1,1,1,1,0
-
- Function Choose(m,n)
- Title: choose(m,n)
- Description: A function that returns the binomial coefficient m!/n!(m-n)!~
- Used in the Binomial Pdf and Hypergeometric Pdf functions.
- Definition: factorial(m)/(factorial(n)*factorial(m-n))
- Location: 80,264
- Nodesize: 48,20
- Paramnames: M, N
-
- Index X2
- Title: x2
- Description: A shorter index for the x values.~
- ~
- If you use the Hypergeometric distribution, edit this to span~
- the range of your x values.
- Definition: sequence(0,8)
- Location: 200,320
- Nodesize: 48,20
-
- Model Pdfs
- Title: PDFs
- Description: Probability density functions ~
- for these distributions. Used ~
- in calculating the distributions.
- Author: Brian Sterling
- Date: Mon, Feb 28, 1994 10:51 PM
- Location: 200,264
- Nodesize: 48,20
- Diagstate: 1,228,72,213,283,1
-
- Function Poisson_pd(alpha,x)
- Title: Poisson Pdf~
- (alpha,x)
- Description: Functional form of Poisson PDF.
- Definition: (alpha^x)*Exp( -alpha )/Factorial(x)
- Location: 88,208
- Nodesize: 48,20
- Paramnames: Alpha, X
-
- Function Binom_pdf(n,p,x)
- Title: Binomial Pdf~
- (n,p,x)
- Definition: if p=1 and n=x then 1 else choose(n,x) * p^x * (1-p)^(n-x)
- Location: 88,40
- Nodesize: 48,20
- Paramnames: N, P, X
-
- Function Geo_pdf(p,x)
- Title: Geometric Pdf~
- (p,x)
- Definition: p*(1-p)^x
- Location: 88,96
- Nodesize: 48,20
- Paramnames: P, X
-
- Function Hyper_pdf(n,D,M,x)
- Title: Hypergeometric Pdf(n,D,M,x)
- Definition: choose(D,x)*choose(M-D,n-x)/choose(M,n)
- Location: 88,152
- Nodesize: 52,20
- Paramnames: N, D, M, X
-
- Close Pdfs
-
- Function Poisson(alpha)
- Title: Poisson(alpha)
- Description: The Poisson distribution - alpha is the rate.
- Definition: Chancedist(Xindex,Poisson_pd(alpha,Xindex),
- Xindex)
- Location: 200,120
- Nodesize: 48,20
- Paramnames: Alpha
-
- Function Binomial(n,p)
- Title: Binomial(n,p)
- Description: The binomial distribution - n is the number of trials, p is the probability.
- Definition: Chancedist(xindex,Binom_pdf(N, P,xindex),xindex)
- Location: 80,56
- Nodesize: 48,20
- Paramnames: N, P
-
- Function Geometric(p)
- Title: Geometric(p)
- Description: The geometric distribution - p is the probability.
- Definition: Chancedist(Xindex,Geo_pdf(p,Xindex),Xindex)
- Location: 200,56
- Nodesize: 48,20
- Paramnames: P
-
- Function Hypergeo(n,D,M)
- Title: Hypergeometric(n,D,M)
- Description: The hypergeometric distribution - n is the sample size, D is the expected number of one outcome, M is the population size.
- Definition: Chancedist(X2,Hyper_pdf(n,D,M,X2),X2)
- Location: 80,120
- Nodesize: 52,20
- Paramnames: N, D, M
-
- Model Examples
- Title: Examples
- Description: Examples of the use of these distributions.~
- x index (or x2 for Hypergeometric) must be edited to span the x-values of your distribution.
- Author: Brian Sterling
- Date: Mon, Feb 28, 1994 10:51 PM
- Location: 136,184
- Nodesize: 48,20
- Diagstate: 1,439,112,363,255,1
-
- Chance Poisson_ex
- Title: Poisson Ex.
- Description: An example showing how to display the Poisson~
- distribution as a probability mass function.
- Definition: Frequency( Poisson(12), Xindex ) / samplesize
- Location: 80,208
- Nodesize: 48,20
- Valuestate: 1,51,550,608,293,1,MIDM
- Graphsetup: Distresol:4~
- Diststeps:1~
- Symbolsize:6~
- Linestyle:9~
- Frame:1~
- Grid:1~
- Ticks:1~
- Mesh:1~
- Scales:1~
- Frameauto:1~
- Xminimum:0~
- Xmaximum:30~
- Yminimum:0~
- Ymaximum:1~
- Zminimum:1~
- Zmaximum:15~
- Xintervals:0~
- Yintervals:0~
-
- Reformval: [Xindex ,Undefined ]
-
- Chance Binomial_ex
- Title: Binomial Ex.
- Description: An example showing how to display the Binomial~
- distribution as a probability mass function.~
- The first argument of Binomial() must be edited to equal the maximum value of the index 'x index'.
- Definition: Frequency( Binomial(30,0.8), Xindex ) / samplesize
- Location: 80,40
- Nodesize: 48,20
- Valuestate: 1,455,461,619,288,1,MIDM
- Graphsetup: Distresol:4~
- Diststeps:1~
- Symbolsize:6~
- Linestyle:9~
- Frame:1~
- Grid:1~
- Ticks:1~
- Mesh:1~
- Scales:1~
- Frameauto:1~
- Xminimum:0~
- Xmaximum:30~
- Yminimum:0~
- Ymaximum:0.2~
- Zminimum:1~
- Zmaximum:1~
- Xintervals:0~
- Yintervals:0~
-
- Reformval: [Xindex ,Undefined ]
-
- Chance Geometric_ex
- Title: Geometric Ex.
- Description: An example showing how to display the Geometric~
- distribution as a probability mass function.
- Definition: Frequency( Geometric(0.3), Xindex ) / samplesize
- Location: 80,96
- Nodesize: 48,20
- Valuestate: 1,403,465,416,303,1,MIDM
- Graphsetup: Distresol:4~
- Diststeps:1~
- Symbolsize:6~
- Linestyle:9~
- Frame:1~
- Grid:1~
- Ticks:1~
- Mesh:1~
- Scales:1~
- Frameauto:1~
- Xminimum:0~
- Xmaximum:30~
- Yminimum:0~
- Ymaximum:1~
- Zminimum:1~
- Zmaximum:1~
- Xintervals:0~
- Yintervals:0~
-
- Reformval: [Xindex ,Undefined ]
-
- Chance Hypergeo_ex
- Title: Hypergeo Ex.
- Description: An example showing how to display the Hypergeometric~
- distribution as a probability mass function.~
- The first argument of Hypergeo() must equal the maximum value of the index x2.
- Definition: Frequency( Hypergeo(8,17,30), X2 ) / samplesize
- Location: 80,152
- Nodesize: 48,20
- Valuestate: 1,314,481,416,303,1,MIDM
- Graphsetup: Distresol:4~
- Diststeps:1~
- Symbolsize:6~
- Linestyle:9~
- Frame:1~
- Grid:1~
- Ticks:1~
- Mesh:1~
- Scales:1~
- Frameauto:1~
- Xminimum:0~
- Xmaximum:30~
- Yminimum:0~
- Ymaximum:1~
- Zminimum:1~
- Zmaximum:1~
- Xintervals:0~
- Yintervals:0~
-
- Reformval: [Xindex ,Undefined ]
-
- Index Bern_out
- Title: Bernoulli outcomes
- Description: A list of the possible outcomes of the Bernoulli distribution. ~
- This is needed in order to display the Bernoulli distribution as ~
- a probability mass function.
- Definition: [0,1]
- Location: 208,40
- Nodesize: 48,20
-
- Chance Bernoulli_1
- Title: Bernoulli Ex.
- Description: Example of the built-in Bernoulli distribution.
- Definition: Bernoulli(0.3)
- Location: 208,96
- Nodesize: 48,20
-
- Chance Bernprobmass
- Title: Bernoulli Prob Mass
- Description: An example showing how to display the builtin Bernoulli ~
- distribution as a probability mass function.
- Definition: Frequency(Bernoulli_1,Bern_out)/samplesize
- Location: 208,152
- Nodesize: 48,20
- Valuestate: 1,232,242,416,303,1,MIDM
- Graphsetup: Distresol:4~
- Diststeps:1~
- Symbolsize:6~
- Linestyle:9~
- Frame:1~
- Grid:1~
- Ticks:1~
- Mesh:1~
- Scales:1~
- Frameauto:1~
- Xminimum:0~
- Xmaximum:1~
- Yminimum:0~
- Ymaximum:1~
- Zminimum:1~
- Zmaximum:1~
- Xintervals:0~
- Yintervals:0~
-
-
- Close Examples
-
- Close Discdist
-
-